﻿<%-- 
    Copyright (C) Binod Nepal, Planet Earth Solutions Pvt. Ltd., Kathmandu.
	Released under the terms of the GNU General Public License, GPL, 
	as published by the Free Software Foundation, either version 3 
	of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
--%>

<%@ Page Title="" Language="C#" MasterPageFile="~/Classifieds/Main.Master" AutoEventWireup="true"
    CodeBehind="Play.aspx.cs" Inherits="MixNP.Web.Classifieds.Play" Async="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="StyleSheetContentPlaceHolder" runat="server">
    <style type="text/css">
        .thumbnail
        {
            float: left;
            padding: 4px;
            margin: 4px;
            border: 1px solid #DEDEDE;
            cursor: pointer;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ScriptsContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="BodyContentPlaceHolder" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <div id="spinner" class="ajax-container" style="display: none">
        <img alt="progress" src="/spinner.gif" class="ajax-loader" />
    </div>
    <asp:UpdateProgress ID="updProgress" runat="server">
        <ProgressTemplate>
            <div class="ajax-container">
                <img alt="progress" src="/spinner.gif" class="ajax-loader" />
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="NextLinkButton1" />
            <asp:AsyncPostBackTrigger ControlID="WatchlistLinkButton1" />
            <asp:AsyncPostBackTrigger ControlID="WatchlistLinkButton2" />
            <asp:AsyncPostBackTrigger ControlID="WishlistLinkButton1" />
            <asp:AsyncPostBackTrigger ControlID="WishlistLinkButton2" />
        </Triggers>
        <ContentTemplate>
            <div class="panel">
                <h1>
                    <asp:Literal ID="TitleLiteral" runat="server" />
                </h1>
                <hr class="hr" />

                <p>
                    <asp:Literal ID="DescriptionLiteral" runat="server" />
                </p>

                <h1>
                    Want This?</h1>
                <div class="play">
                    <asp:HyperLink ID="ShowHyperLink1" runat="server" Text="Show Me" Target="_blank" />
                    <asp:LinkButton ID="NextLinkButton1" runat="server" Text="Next" OnClick="NextLinkButton_Click" />
                    <asp:LinkButton ID="WatchlistLinkButton1" runat="server" Text="Add to My Watchlist"
                        OnClick="WatchlistLinkButton_Click" />
                    <asp:LinkButton ID="WishlistLinkButton1" runat="server" Text="Add to My Wishlist"
                        OnClick="WishlistLinkButton_Click" />
                </div>
                <asp:Literal ID="ImageLiteral" runat="server" />
                <h1>
                    Want This?</h1>
                <div class="play">
                    <asp:HyperLink ID="ShowHyperLink2" runat="server" Text="Show Me" Target="_blank" />
                    <asp:HyperLink ID="NotNowHyperLink2" runat="server" Text="Next" />
                    <asp:LinkButton ID="WatchlistLinkButton2" runat="server" Text="Add to My Watchlist"
                        OnClick="WatchlistLinkButton_Click" />
                    <asp:LinkButton ID="WishlistLinkButton2" runat="server" Text="Add to My Wishlist"
                        OnClick="WishlistLinkButton_Click" />
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ScriptsContentPlaceHolderBottom"
    runat="server">
    <script type="text/javascript">
        var displayImage = function (container, path) {
            var el = $("#spinner");
            el.show();

            var main = $("#" + container);

            if (main.attr('src') == path) {
                el.hide();
                return;
            }

            main.attr('src', path);

            main.load(function () {
                el.hide();
            });
        }
    </script>

    <script type="text/javascript">
        jQuery(document).ready(function () {
            $(".ajax-container").height($(document).height() + 100);
        }
        );        
    </script>

</asp:Content>